home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
EDUCMISC
/
EDPAK_5.LZH
/
TT.BAS
< prev
next >
Wrap
BASIC Source File
|
1980-01-01
|
15KB
|
561 lines
4 DEFINT A-R,Y-Z
35 DIM K$(80)
40 DIM L$(266)
45 DIM CK(1000)
50 DIM W$(1000)
70 CH = 29
75 PRINT FRE(0)
78 KEY OFF
80 GOSUB 52000
100 GOSUB 50000
150 TF = 50
200 GOTO 40000
500 REM ******* CLS
510 CLS
520 RETURN
8000 REM ***** FILE NAME ACCEPLABLE TEST ************
8010 TEST = 1
8100 FOR Q = 1 TO LEN(A$)
8110 K$(Q) = MID$(A$,Q,1)
8120 C = ASC(K$(Q))
8130 IF C < 48 OR C > 122 THEN TEST = 4
8140 IF Q = 1 AND ( C < 65 OR C > 122 ) THEN TEST = 4
8150 NEXT Q
8190 RETURN
13100 REM locate
13110 LOCATE LI,TB
13120 RETURN
20000 REM letter practice
20010 GOSUB 28000
20020 FOR T = 1 TO 256
20030 CK(T) = 0
20040 NEXT T
20100 N = 1
20110 GOSUB 500
20120 TC = 1
20125 N = INT( RND * (MX + 1 ))
20130 IF L$(N) = "" OR L$(N) = " " THEN 20300
20140 IF CK(N) > 2 THEN 20300
20200 PRINT L$(N)
20210 C$ = INKEY$
20220 TC = TC + 1
20225 IF TC = INT(TF * 1.5)THEN PRINT "time"
20230 IF C$ = "" THEN 20210
20235 C = ASC(C$)
20237 IF C = 27 THEN 40000
20240 IF TC < (TF * 1.5) AND C$ = L$(N) THEN GOTO 20600
20245 IF C$ <> L$(N) THEN BEEP
20250 IF C$ <> L$(N) THEN 20210
20300 N = N + 1
20310 IF N = 256 THEN 20100
20400 GOTO 20110
20600 REM increase count
20605 G = 0
20610 CK(N) = CK(N) + 1
20620 G = G + 1
20625 IF G = MX + 1 THEN 20700
20630 IF CK(G) < 2 THEN 20245
20640 GOTO 20620
20700 REM all done
20705 PRINT ""
20710 PRINT " End of Exercise "
20720 PRINT " Do you want to do the exercise again ?"
20730 PRINT " 1 - repeat same exercise "
20740 PRINT " 2 - back to main menu "
20745 PRINT " Enter the number then press return "
20750 GOSUB 60000
20760 IF DT# < 1 OR DT# > 2 THEN 20750
20770 IF DT# = 1 THEN 20020 ELSE 40000
23000 REM READ FILES
23050 PRINT "READING DATA FROM DISK. PLEASE WAIT. "
23100 OPEN "I",#1,"LETTERS"
23110 N = 1
23120 IF EOF(1) THEN 23900
23130 LINE INPUT #1,L$(N)
23135 REM PRINT L$(N),N
23140 N = N + 1
23150 GOTO 23120
23900 CLOSE 1
24100 OPEN "I",#1,"WORDTYPE"
24110 N = 1
24120 IF EOF(1) THEN 24900
24130 INPUT #1,W$(N)
24135 REM PRINT W$(N)
24137 IF ASC(W$(N)) > 127 THEN W$(N) = MID$(W$(N),2)
24140 N = N + 1
24150 GOTO 24120
24900 CLOSE
24910 RETURN
28000 REM level
28100 GOSUB 500
28110 PRINT " WHAT LEVEL DO YOU WANT TO PRACTICE AT "
28120 PRINT ""
28130 PRINT " 1 - BEGINNER, KEYS A,S,D,F,G,H,J,K,L,;"
28140 PRINT " 2 - ABOVE KEYS PLUS q,w,e,r,t,y,u,i,o,p "
28150 PRINT " 3 - Above keys plus z,x,c,v,b,n,m,,,.,"
28160 PRINT " 4 - Above keys plus numbers "
28170 PRINT " 5 - Above keys plus Capital letters "
28180 PRINT " 6 - Above keys plus special characters "
28300 GOSUB 60000
28310 IF DT# < 1 OR DT# > 6 THEN 28300
28320 IF DT# = 1 THEN MX = 10
28330 IF DT# = 2 THEN MX = 20
28340 IF DT# = 3 THEN MX = 29
28350 IF DT# = 4 THEN MX = 39
28369 IF DT# = 5 THEN MX = 65
28380 IF DT# = 6 THEN MX = 256
28500 RETURN
29000 REM level of word practice
29010 GOSUB 500
29100 PRINT " How many words do you want to practice "
29110 PRINT " 1 - the first 50 words "
29120 PRINT " 2 - the first 100 words "
29130 PRINT " 3 - the first 200 words "
29140 PRINT " 4 - the first 300 words "
29150 PRINT " 5 - the first 400 words "
29160 PRINT " 6 - the first 500 words "
29170 PRINT " 7 - all the words "
29300 PRINT " Enter the number then press return "
29400 GOSUB 60000
29410 IF DT# < 1 OR DT# > 7 THEN 29400
29420 IF DT# = 1 THEN MX = 50
29430 IF DT# = 2 THEN MX = 100
29440 IF DT# = 3 THEN MX = 200
29450 IF DT# = 4 THEN MX = 300
29460 IF DT# = 5 THEN MX = 400
29470 IF DT# = 6 THEN MX = 500
29480 IF DT# = 7 THEN MX = 600
29500 RETURN
30000 REM print words
30007 EFLG = 0
30020 FOR T = 1 TO 600
30030 CK(T) = 0
30040 NEXT T
30050 GOSUB 29000
30100 N = 1
30110 GOSUB 500
30120 TC = 1
30125 EFLG = 0
30130 IF W$(N) = "" OR W$(N) = " " THEN 30310
30140 IF CK(N) > 2 THEN 30300
30150 H = 1
30160 T$ = W$(N)
30170 L = LEN(T$)
30200 PRINT W$(N)
30210 C$ = INKEY$
30215 IF H = L + 1 THEN 30300
30220 TC = TC + 1
30225 IF TC = INT(TF * L * .5) THEN PRINT "*";
30230 IF C$ = "" OR C$ = " " THEN 30210
30235 C = ASC(C$)
30237 IF C = 27 THEN 40000
30240 IF C$ = MID$(T$,H,1) THEN 30500 ELSE 31000
30300 REM
30305 IF EFLG = 0 AND TC < ( INT(TF * L * .5)) THEN CK(N) = CK(N) + 1
30310 N = N + 1
30320 IF N > MX THEN N = 1
30400 IF N > 1 GOTO 30110
30410 R = 1
30420 IF R = MX + 1 THEN 30450
30430 IF CK(R) < 3 THEN 30110
30435 R = R + 1
30440 GOTO 30420
30450 REM end of words
30460 PRINT " End of Word Practice "
30465 PRINT " You have typed every word correct 3 times "
30470 PRINT " press any key to continue "
30480 IF INKEY$ = "" THEN 30480
30490 GOTO 40000
30500 REM right key
30510 H = H + 1
30515 PRINT C$;
30520 GOTO 30210
31000 REM wrong key
31100 BEEP
31110 EFLG = 1
31200 GOTO 30210
35000 REM letter game
35010 SC = 0
35020 TI = TF
35050 GOSUB 28000
35100 GOSUB 500
35102 SC = 0
35103 TI = TF
35105 P$ = ""
35110 N = 1
35120 N = INT( RND *(MX+1))
35122 IF L$(N) = "" OR L$(N) = " " THEN 35120
35123 P$ = L$(N) + P$
35125 KT = 0
35127 LI = 1
35128 TB = 1
35130 GOSUB 13100
35135 IF LEN(P$) = 12 THEN GOTO 39000
35140 PRINT P$;TAB(12) "[";TAB(50) SC
35200 C$ = INKEY$
35210 KT = KT + 1
35220 IF KT > TI THEN N = N + 1
35230 IF KT > TI THEN 35120
35240 IF C$ = "" THEN 35200
35250 C = ASC(C$)
35260 IF C = 27 THEN 40000
35300 IF INSTR(P$,C$) = 0 THEN 35900
35310 L = LEN(P$)
35320 FOR T = 1 TO L
35330 IF C$ = MID$(P$,T,1) THEN HD = T
35340 NEXT T
35350 LFT = HD - 1
35360 RGT = L - HD
35370 R$ = RIGHT$(P$,RGT)
35380 L$ = LEFT$(P$,LFT)
35390 P$ = L$ + R$
35395 SC = SC + 250
35397 TI = TI - .2
35400 GOTO 35200
35900 REM miss
35910 BEEP
35920 MI = MI + 1
35925 SC = SC - 1000
35930 GOTO 35130
39000 PRINT ""
39100 BEEP
39200 PRINT " END OF GAME "
39210 PRINT " do you want to play the same game again "
39230 PRINT " 1 - yes "
39240 PRINT " 2 - no "
39250 GOSUB 60000
39260 IF DT# < 1 OR DT# > 2 THEN 39250
39270 IF DT# = 1 THEN 35100
40000 REM ******* FILE DESCRIPTION MENU *********
40060 GOSUB 500
40080 PRINT "**************** INITIAL MENU ******************"
40100 PRINT ""
40120 PRINT " 0 - EXIT "
40125 PRINT ""
40140 PRINT " 1 - INDIVIDUAL LETTER PRACTICE "
40145 PRINT ""
40160 PRINT " 2 - WORD PRACTICE "
40165 PRINT ""
40180 PRINT " 3 - LETTER GAME "
40185 PRINT ""
40200 PRINT " 4 - CHANGE TIMING "
40210 PRINT ""
40260 PRINT "***** ENTER THE NUMBER THEN PRESS RETURN ******"
40280 GOSUB 60000
40282 IF DT# <0 OR DT# >4 THEN 40280
40300 T = DT#
40310 IF T = 0 THEN 51000
40320 ON T GOTO 20000,30000,35000,45000
40340 GOSUB 500
45000 REM TIMING
45100 GOSUB 500
45110 PRINT " This option is used to change the amount of time you have to"
45120 PRINT "type in each letter. Different computers run at different speeds"
45125 PRINT "You may want to practice at a faster speed. "
45130 PRINT "current time factor is ";TF
45140 PRINT "Enter a lower number to have less time to type in each number"
45150 PRINT "Enter a higher number to have more time to type in each number"
45300 GOSUB 60060
45310 IF DT# < 1 OR DT# > 1000 THEN 45300
45320 TF = DT#
45500 GOTO 40000
50000 REM ********** INTRO
50010 GOSUB 500
50100 PRINT " T Y P I N G T E A C H E R P R O G R A M 1.0 "
50105 PRINT ""
50110 PRINT " Copyright 1985 by Potomac Pacific Engineering Inc."
50120 PRINT ""
50130 PRINT "This program is licensed FREE to all users with some restrictions"
50165 PRINT " See the manual for more information on the license."
50167 PRINT ""
50920 GOSUB 23000
50950 PRINT "****************** PRESS ANY KEY TO CONTINUE *****************";
50960 IF INKEY$ = "" GOTO 50960
50970 RETURN
51000 REM ***** EXIT TO SYSTEM
51100 GOSUB 500
51110 CLOSE
51120 PRINT " -BYE, Have a nice day"
51130 END
52000 REM ***** INTRO 1
52010 GOSUB 500
52100 PRINT " Put the TYPING TEACHER DISK in the default disk drive "
52110 PRINT ""
52120 PRINT " ***** THEN PRESS ANY KEY TO CONTINUE *****"
52130 PRINT ""
52140 PRINT " The program needs to read files off of the typing teacher disk"
52200 IF INKEY$ = "" GOTO 52200
52210 RETURN
53000 REM ********** READ IDEX SUBROUTINE
53010 OPEN "I",#1,"REALTIME"
53020 FOR T = 1 TO MAXF
53030 INPUT #1,REALFLG(T)
53040 NEXT T
53050 CLOSE #1
53060 REALFLG(A) = 0
53070 REM ********** WRITE IDEX SUBROUTINE
53080 OPEN "O",#1,"REALTIME"
53090 FOR T = 1 TO 30
53100 WRITE #1,REALFLG(T)
53110 NEXT T
53120 CLOSE #1
53130 RETURN
60000 REM ******* INTEGER LESS THEN 100 CHECK ********
60010 MAX = 2
60020 ACT$ = "1234567890=<>^"
60030 IF NE = 0 THEN ACT$ = "1234567890"
60040 PRINT ">__<";
60050 GOTO 60240
60060 REM ******* INTEGER *******
60070 MAX = 8
60080 ACT$ = "1234567890-+,=<>^"
60090 IF NE = 0 THEN ACT$ = "1234567890-+,"
60100 PRINT ">________<";
60110 GOTO 60240
60120 REM ******* SINGLE PRECISION *******
60130 MAX = 10
60140 ACT$ = "1234567890-+,.%$=<>^"
60150 IF NE = 0 THEN ACT$ = "1234567890+-,.%$"
60160 PRINT ">__________<";
60170 GOTO 60240
60180 REM ******* DOUBLE PRECISION *******
60190 MAX = 20
60200 ACT$ = "1234567890-+,.%$=<>^"
60210 IF NE = 0 THEN ACT$ = "1234567890+-,.%$"
60220 PRINT ">____________________<";
60230 GOTO 60240
60240 REM ********** NUMBER CHECK **********
60250 A$ = ""
60260 K$(20) = " "
60270 KTMAX = 0
60280 FOR T9 = 1 TO MAX
60290 K$(T9) = " "
60300 NEXT T9
60310 DIG$ = "1234567890."
60320 DOTFLG = 0
60330 T2 = MAX + 1
60340 FOR T6 = 1 TO T2
60350 PRINT CHR$(CH);
60360 NEXT T6
60370 IF INKEY$ = "" GOTO 60380 ELSE GOTO 60370
60380 KT = 0
60390 REM *********** CHECK ALFANUMERIC INPUT FOR LENGTH ***********
60400 KT = KT + 1
60410 REM
60420 W$ = INKEY$
60430 IF W$ = "" GOTO 60420
60440 C = ASC(W$)
60450 IF C = 0 THEN GOSUB 61900
60460 IF C = 13 GOTO 60580
60470 IF C = 17 OR C = 8 GOTO 61150
60480 IF C = 19 GOTO 60670
60490 IF C = 4 GOTO 60720
60500 IF C = 6 GOTO 60780
60510 IF C = 1 GOTO 60960
60520 IF KT > MAX GOTO 60410
60530 IF INSTR(ACT$,W$) = 0 GOTO 61230
60540 K$(KT) = W$
60550 PRINT K$(KT);
60560 IF KT > KTMAX THEN KTMAX = KT
60570 GOTO 60400
60580 REM ********** RETURN **********
60590 FOR T9 = 1 TO KTMAX
60600 A$ = A$ + K$(T9)
60610 NEXT T9
60620 IF KTMAX = 0 THEN PRINT "1"
60630 IF KTMAX = 0 THEN DT# = 1
60640 IF KTMAX = 0 THEN RETURN
60650 PRINT ""
60660 GOTO 61260
60670 REM ********* MOVE CURSE BACK ********
60680 IF KT = 1 GOTO 60410
60690 KT = KT - 1
60700 PRINT CHR$(CH);
60710 GOTO 60410
60720 REM ********* MOVE CURSER FORWARD *********
60730 IF KT >= MAX GOTO 60410
60740 IF KT > (KTMAX + 1) GOTO 60410
60750 PRINT K$(KT);
60760 KT = KT + 1
60770 GOTO 60410
60780 REM ********** INSERT ***********
60790 IF KT > KTMAX GOTO 60410
60800 X9 = MAX
60810 WHILE X9 > KT
60820 X9 = X9 - 1
60830 K$(X9 + 1) = K$(X9)
60840 WEND
60850 K$(KT) = " "
60860 KTMAX = KTMAX + 1
60870 IF KTMAX > MAX THEN KTMAX = MAX
60880 FOR T9 = KT TO KTMAX
60890 PRINT K$(T9);
60900 NEXT T9
60910 T6 = (KTMAX - KT) + 1
60920 FOR T7 = 1 TO T6
60930 PRINT CHR$(CH);
60940 NEXT T7
60950 GOTO 60410
60960 REM ********** DELETE ***********
60970 IF KT > KTMAX GOTO 60410
60980 IF KTMAX = 1 GOTO 60410
60990 K$(MAX + 1) = ""
61000 X9 = KT
61010 WHILE X9 <= MAX
61020 K$(X9) = K$(X9 + 1)
61030 X9 = X9 + 1
61040 WEND
61050 KTMAX = KTMAX - 1
61060 FOR T9 = KT TO KTMAX
61070 PRINT K$(T9);
61080 NEXT T9
61090 PRINT "_";
61100 T7 = (KTMAX - KT) + 2
61110 FOR T8 = 1 TO T7
61120 PRINT CHR$(CH);
61130 NEXT T8
61140 GOTO 60410
61150 REM ********* BACKSPACE ********
61160 IF KT = 1 GOTO 60410
61170 KT = KT - 1
61180 PRINT CHR$(CH);
61190 K$(KT) = " "
61200 PRINT "_";
61210 PRINT CHR$(CH);
61220 GOTO 60410
61230 REM ******* INPUT NOT ACCEPTABLE ********
61240 PRINT CHR$(7);
61250 GOTO 60420
61260 REM ********* CLEAR STRINGS ********
61270 MAX = LEN(A$)
61280 D2$ = ""
61290 D1$ = ""
61300 DFLG = 0
61310 FOR Q93 = 1 TO MAX
61320 R$ = MID$(A$,Q93,1)
61330 IF INSTR(DIG$,R$) = 0 GOTO 61400
61340 IF R$ = "." OR DFLG = 1 GOTO 61380
61350 IF DFLG = 1 GOTO 61380
61360 D2$ = D2$ + R$
61370 GOTO 61400
61380 D1$ = D1$ + R$
61390 DFLG = 1
61400 NEXT Q93
61410 DA# = VAL(D2$)
61420 D1# = VAL(D1$)
61430 DT# = DA# + D1#
61440 IF K$(1) = "-" THEN DT# = -DT#
61450 RETURN
61900 REM ****** CHECK FOR ASC0
61910 S4$ = INKEY$
61915 IF S4$ = "" THEN RETURN
61920 C2 = ASC(S4$)
61930 IF C2 = 83 THEN C = 1
61940 IF C2 = 82 THEN C = 6
61950 IF C2 = 75 THEN C = 19
61960 IF C2 = 77 THEN C = 4
61970 RETURN
62000 REM ********** ALPHANUMERIC CHECK **************
62010 MAX = FL(A,Q)
62020 GOTO 62040
62030 REM ******** MAX SET IN PROGRAM ********
62040 A$ = ""
62050 PRINT ">";
62060 FOR N9 = 1 TO MAX
62070 K$(N9) = ""
62080 PRINT "_";
62090 NEXT N9
62100 PRINT "<";
62110 T2 = MAX + 1
62120 FOR T4 = 1 TO T2
62130 PRINT CHR$(CH);
62140 NEXT T4
62150 KT = 0
62160 KTMAX = 1
62170 REM *********** CHECK ALFANUMERIC INPUT FOR LENGTH ***********
62180 KT = KT + 1
62190 PRINT TAB(KT+1)"";
62200 K$ = INKEY$
62210 IF K$ = "" GOTO 62200
62220 C = ASC(K$)
62230 IF C = 0 THEN GOSUB 61900
62240 IF C = 13 GOTO 62350
62250 IF C = 17 OR C = 8 GOTO 62920
62260 IF C = 19 GOTO 62450
62270 IF C = 4 GOTO 62500
62280 IF C = 6 GOTO 62560
62290 IF C = 1 GOTO 62730
62300 IF KT > MAX GOTO 62190
62310 K$(KT) = K$
62320 PRINT K$(KT);
62330 IF KT > KTMAX THEN KTMAX = KT
62340 GOTO 62180
62350 REM ********** RETURN **********
62360 FOR T9 = 1 TO MAX
62370 A$ = A$ + K$(T9)
62420 NEXT T9
62430 PRINT ""
62440 RETURN
62450 REM ********* MOVE CURSE BACK ********
62460 IF KT = 1 GOTO 62190
62470 KT = KT - 1
62480 PRINT CHR$(CH);
62490 GOTO 62190
62500 REM ********* MOVE CURSER FORWARD *********
62510 IF KT >= MAX GOTO 62190
62520 IF KT > KTMAX GOTO 62190
62530 PRINT K$(KT);
62540 KT = KT + 1
62550 GOTO 62190
62560 REM ********** INSERT ***********
62570 X9 = MAX
62580 WHILE X9 > KT
62590 X9 = X9 - 1
62600 K$(X9 + 1) = K$(X9)
62610 WEND
62620 K$(KT) = " "
62630 KTMAX = KTMAX + 1
62640 IF KTMAX > MAX THEN KTMAX = MAX
62650 FOR T9 = KT TO KTMAX
62660 PRINT K$(T9);
62670 NEXT T9
62680 T6 = (KTMAX - KT) +1
62690 FOR T7 = 1 TO T6
62700 PRINT CHR$(CH);
62710 NEXT T7
62720 GOTO 62190
62730 REM ********** DELETE ***********
62740 IF KT > KTMAX GOTO 62200
62750 IF KTMAX = 1 GOTO 62190
62760 K$(MAX + 1) = ""
62770 X9 = KT
62780 WHILE X9 <= KTMAX
62790 K$(X9) = K$(X9 + 1)
62800 X9 = X9 + 1
62810 WEND
62820 KTMAX = KTMAX - 1
62830 FOR T9 = KT TO KTMAX
62840 PRINT K$(T9);
62850 NEXT T9
62860 PRINT "_";
62870 T7 = (KTMAX - KT) + 2
62880 FOR T6 = 1 TO T7
62890 PRINT CHR$(CH);
62900 NEXT T6
62910 GOTO 62190
62920 REM ********* BACKSPACE ********
62930 IF KT = 1 GOTO 62190
62940 K$(KT) = " "
62950 KT = KT - 1
62960 K$(KT) = " "
62970 PRINT CHR$(CH);
62980 PRINT "_";
62990 PRINT CHR$(CH);
63000 GOTO 62190
" "
62950 KT = KT - 1
62960 K$(KT) = " "
62970 PRINT CHR$(CH);
62980 PRINT "_";
62990 PRINT CHR$(CH);
63000